<div class="js-tabs">
	<ul>
		<li><a href="#tab-general">Général</a></li>
		<?php if ($user->status_code != 'admin') { ?>
		<li><a href="#tab-status">Historique</a></li>
		<li><a href="#tab-inscr">Dossier d'inscription</a></li>
		<?php } ?>
		<li><a href="#tab-connect">Connexions</a></li>
	</ul>
	<div id="tab-general">
		<table class="details">
			<tr>
				<td>Nom</td>
				<td><?= $user->name ?></td>
			</tr>
			<tr>
				<td>Prénom</td>
				<td><?= $user->firstname ?></td>
			</tr>
			<tr>
				<td>E-mail</td>
				<td><a href="mailto:<?= $user->email ?>"><?= $user->email ?></a></td>
			</tr>
			<tr>
				<td>Statut</td>
				<td><?= $user->status_label ?></td>
			</tr>
			<tr>
				<td>Compte créé le</td>
				<td><?= time_to_str_long($user->created_at) ?></td>
			</tr>
			<tr>
				<td>Compte mise à jour le</td>
				<td><?= time_to_str_long($user->updated_at) ?></td>
			</tr>
		</table>
	</div>
	<?php if ($user->status_code != 'admin') { ?>
	<div id="tab-status">
		<table class="details">
			<tr>
				<th>Statut</th>
				<th>Assigné le</th>
				<th>Assigné par</th>
			</tr>
			<?php foreach ($status_history as $status) { ?>
				<tr>
					<td><?= $status->status_label ?></td>
					<td><?= time_to_str_long($status->created_at) ?></td>
					<td><?= $status->creator_firstname ?> <?= $status->creator_name ?></td>
				</tr>
			<?php } ?>
		</table>
	</div>
	<div id="tab-inscr">
		<table class="details">
			<?php
			$previous_step = 0;
			foreach ($insc_entries as $entry) {
				if ($previous_step != $entry->field_step_number) {
					echo '<tr><td colspan="2" class="separator">&nbsp;</td></tr>';
				}
				$previous_step = $entry->field_step_number;
				?>
				<tr>
					<td><?= $entry->field_label ?></td>
					<td><?= $this->Insc->get_entry_value($entry) ?></td>
				</tr>
			<?php } ?>
		</table>
	</div>
	<?php } ?>
	<div id="tab-connect">
		<table class="details">
			<tr>
				<td>Dernière connexion le</td>
				<td><?= time_to_str_long($user->last_connection) ?></td>
			</tr>
			<tr>
				<td>Nombre de connexions</td>
				<td><?= $user->connection_count ?></td>
			</tr>
			<tr>
				<td>Dernière IP utilisée</td>
				<td><?= $user->last_used_ip ?></td>
			</tr>
		</table>
	</div>
</div>
